<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width,minimum-scale=1">

  <title>{% if page.title %}{{ page.title | escape }}{% else %}{{ site.title | escape }}{% endif %}</title>
  <meta name="description" content="{{ page.content | strip_html | strip_newlines | truncate: 160 }}">

  <link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url | relative_url }}">
  <link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url | relative_url }}">

  {% include fb_tags.html %}

  <script type="application/ld+json">
  {% include metadata.json %}
  </script>
  <link rel="stylesheet" href="{{ site.css_url | relative_url }}/styles.css">

  <!-- <link rel="manifest" href="/manifest.json"> -->
  <!-- <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#efae0a"> -->
  <meta name="msapplication-TileColor" content="#da532c">
  <meta name="msapplication-TileImage" content="/mstile-144x144.png">
  <meta name="theme-color" content="#233947">

  <!-- Favicon -->
  <link rel="shortcut icon" type="image/x-icon" href="{{ site.favicon_path | relative_url }}">

  <!-- MathJax Config -->
  {% include mathjax.html %}

  <!-- DOM updating function -->
  <script src="{{ site.js_url | relative_url }}/page/dom-update.js"></script>

  <!-- Selectors for elements on the page -->
  <script src="{{ site.js_url | relative_url }}/page/documentSelectors.js"></script>

  <!-- Define some javascript variables that will be useful in other javascript -->
  <script>
    const site_basename = '{{ site.baseurl | strip / }}';
  </script>

  <!-- Add AnchorJS to let headers be linked -->
  <script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/4.2.0/anchor.min.js" async></script>
  <script src="{{ site.js_url | relative_url }}/page/anchors.js" async></script>

  <!-- Include Turbolinks to make page loads fast -->
  <!-- https://github.com/turbolinks/turbolinks -->
  <script src="https://cdnjs.cloudflare.com/ajax/libs/turbolinks/5.2.0/turbolinks.js" async></script>
  <meta name="turbolinks-cache-control" content="no-cache">

  <!-- Load nbinteract for widgets -->
  {% include js/nbinteract.html %}

  <!-- Load Thebelab for interactive widgets -->
  {% include js/thebelab.html %}

  <!-- Load the auto-generating TOC (non-async otherwise the TOC won't load w/ turbolinks) -->
  <script src="https://cdnjs.cloudflare.com/ajax/libs/tocbot/4.8.1/tocbot.min.js" async></script>
  <script src="{{ site.js_url | relative_url }}/page/tocbot.js"></script>

  <!-- Google analytics -->
  {% include google_analytics.html %}

  <!-- Clipboard copy button -->
  <script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" async></script>

  <!-- Load custom website scripts -->
  <script src="{{ site.js_url | relative_url }}/scripts.js" async></script>

  <!-- Load custom user CSS and JS  -->
  <script src="{{ site.custom_static_url | relative_url }}/custom.js" async></script>
  <link rel="stylesheet" href="{{ site.custom_static_url | relative_url }}/custom.css">

  <!-- Update interact links w/ REST param, is defined in includes so we can use templates -->
  {% include js/interact-update.html %}

  <!-- Lunr search code - will only be executed on the /search page -->
  <script src="https://cdnjs.cloudflare.com/ajax/libs/lunr.js/2.3.6/lunr.min.js" async></script>
  <script>{% include search/lunr/lunr-en.js %}</script>

  <!-- Load JS that depends on site variables -->
  <script src="{{ site.js_url | relative_url }}/page/copy-button.js" async></script>

  <!-- Hide cell code -->
  <script src="{{ site.js_url | relative_url }}/page/hide-cell.js" async></script>

  <!-- Printing the screen -->
  {% include js/print.html %}
</head>
